package com.example.springboottest.student.service.impl;

import com.example.springboottest.student.mapper.StuMapper;
import com.example.springboottest.student.model.Student;
import com.example.springboottest.student.service.Stu2MybatisService;
import com.example.springboottest.student.service.Stu3MybatisService;
import com.example.springboottest.student.service.TempService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("stu2MybatisService")
public class Stu2MybatisServiceImpl implements Stu2MybatisService {
    @Autowired
    private StuMapper stuMapper;
    @Autowired
    private Stu3MybatisService Stu3MybatisService;
    @Autowired
    private TempService tempService;

    @Override
    public void idoUpdate() {
        tempService.doReadTempBySession();
        Stu3MybatisService.idoUpdate();
        Student otherStudent = stuMapper.findById("7f798baea8f845419e2b5bbecbb54ecc");
        otherStudent.setAddress("上海市999999");
        stuMapper.update(otherStudent);
    }

    @Override
    public void idoUpdate2() {
        Student otherStudent = stuMapper.findById("d91ee5cc9e664582a39e07b11b2ed36b");
        otherStudent.setAddress("长春市33333");
        stuMapper.update(otherStudent);
        int i = 9 / 0;
    }
}
